Skip to content

feat: Implement support for ToMany relation array syntax in URL patterns#355

Merged
boazpoolman merged 11 commits intopluginpal:masterfrom
candidosales:poc-many-to-many
Apr 19, 2026
Merged

feat: Implement support for ToMany relation array syntax in URL patterns#355
boazpoolman merged 11 commits intopluginpal:masterfrom
candidosales:poc-many-to-many

Conversation

@candidosales
Copy link
Copy Markdown
Contributor

@candidosales candidosales commented Nov 23, 2025

What does it do?

This pull request introduces enhanced support for relation fields—especially "ToMany" (array) relations—in the URL pattern service, along with expanded test coverage and updates to content type schemas to reflect these capabilities. The changes improve how URL patterns can reference and resolve fields within related entities, including those with array indices and dashed/underscored relation names. Additionally, editor and VSCode configuration files are updated for consistency and improved developer experience.

Enhancements to URL Pattern Service:

  • Added support for "ToMany" (array) relations in allowed fields and pattern resolution, enabling URL patterns like [categories[0].slug] and handling both dashed and underscored relation names. [1] [2]
  • Improved pattern field extraction and relation detection to handle array indices and special characters, ensuring accurate validation and resolution of complex patterns. [1] [2] [3]

Testing Improvements:

  • Introduced comprehensive tests for the URL pattern service, covering allowed fields, pattern resolution (including array and relation syntax), validation, and relation extraction.

Schema Updates:

  • Updated private-category and test content type schemas to use many-to-many relations, added url_alias relations, and improved field naming consistency. [1] [2]

Developer Experience:

  • Added .editorconfig and VSCode extension recommendations to enforce consistent code style and encourage use of EditorConfig. [1] [2]
  • Minor cleanup in schema options for the test content type.

Why is it needed?

Describe the issue you are solving.

How to test it?

Running the application using bun run playground:develop or npm run playground:develop

CleanShot.2025-11-23.at.11.32.16.mp4

Add validation when the user omits the array index.

CleanShot 2025-11-23 at 12 10 35@2x

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 23, 2025

🦋 Changeset detected

Latest commit: a27ed48

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
strapi-plugin-webtools Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@candidosales candidosales changed the title [POC] feat: Implement support for ToMany relation array syntax in URL patte… [POC] feat: Implement support for ToMany relation array syntax in URL patterns Nov 23, 2025
Comment thread .vscode/extensions.json
@candidosales candidosales marked this pull request as ready for review November 23, 2025 16:38
@candidosales candidosales changed the title [POC] feat: Implement support for ToMany relation array syntax in URL patterns feat: Implement support for ToMany relation array syntax in URL patterns Nov 23, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.99%. Comparing base (f11641b) to head (a27ed48).
⚠️ Report is 47 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
- Coverage   35.96%   34.99%   -0.97%     
==========================================
  Files           2        2              
  Lines         723      743      +20     
  Branches      172      177       +5     
==========================================
  Hits          260      260              
- Misses        368      389      +21     
+ Partials       95       94       -1     
Flag Coverage Δ
unit 34.99% <ø> (-0.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@boazpoolman boazpoolman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @candidosales.

My apologies that it took so long to review this PR.
I've made some changes and it is ready to merge now.

Will update you as soon as it is released.

@boazpoolman boazpoolman merged commit ac382e4 into pluginpal:master Apr 19, 2026
5 of 6 checks passed
@candidosales
Copy link
Copy Markdown
Contributor Author

@boazpoolman Thanks so much! This update will update my current project :D

@boazpoolman
Copy link
Copy Markdown
Member

Sounds good @candidosales! It's part of version 1.9.0.

Thanks again for your contribution <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants